#!/usr/bin/env python3.3

"""
This program is intended to run tlpy test suite under Python 3. As such,
it should go away once Twisted has been fully ported to Python 3. It is only
intended to be used from a Twisted checkout, and implementation can and will
change at any time.
"""

import sys, os, unittest, tempfile

# Make sure checkout's code is used:
tlpyPath = os.path.abspath(os.path.dirname(os.path.dirname(sys.argv[0])))
sys.path.insert(0, tlpyPath)

if sys.argv[1:]:
    testModules = sys.argv[1:]
else:
    from _tlpypython3 import testModules

# Avoid dumping trash all over the place
os.chdir(tempfile.mkdtemp(prefix="tw-py3-"))

# Run the tests
unittest.main(module=None, argv=["run-python3-tests", "-v"] + testModules)

